import os
from _datetime import datetime

def root_path():
    """获取根目录"""
    root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))).replace('\\', '/')
    return root_path


def get_excel_file():
    """获取excel文件路径"""
    return root_path() + "/data/测试用例完整版.xlsx"


def get_report_path():
    """获取报告的json路径"""
    return root_path() + "/report/json_report"


def get_env_path():
    """获取环境配置路径"""
    return root_path() + "/config/environment.ini"


def get_msg_path():
    """获取消息通知路径"""
    return root_path() + "/config/message.ini"


def get_mysql_path():
    """获取消息通知路径"""
    return root_path() + "/config/mysql.ini"

def get_slow_query_path():
    """慢接口存放的路径"""
    name = datetime.now().strftime("%Y-%m-%d %H_%M_%S")
    return root_path() + f"/slow_query/{name}api_request.csv"